package com.iis.gui.helper;

import java.util.ArrayList;

import javax.swing.table.DefaultTableModel;

import com.iis.entity.Agent;

public class AgentGUIHelper {
	
	public static DefaultTableModel populateData(){
		String col[] = {"Agent ID","Name","Region"};
		DefaultTableModel tableModel = new DefaultTableModel(col, 0);
		
		ArrayList<Agent> arrAgents = Agent.getAll();
		
		for(Agent agent : arrAgents){
			tableModel.addRow(agent.toArray());
		}
		
		return tableModel;	
		
	}
	
	

}
